<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>
<body>
    <div id="app">
        <lay_head></lay_head>
        <lay_head></lay_head>
        <lay_head></lay_head>
    </div>
    <script>
        //全局组件 data(){return{xxx:sss}}
        Vue.component("lay_head",{
            template:`
                <div>
                    <h3>{{msg}}</h3>
                    <button @click="show">按钮</button>
                </div>
            `,
            data(){
                return {
                    msg:"1111"
                }
            },
            methods:{
                show(){
                    alert(this.msg)
                }
            }

        })
        new Vue({
            el:"#app",
            data:{
                msg:"嘻嘻嘻嘻嘻"
            },
            methods: {
                
            },
        })
    </script>
    
</body>
</html>